package com.szeldon.declatest.declaration.scenario.parts;

import com.szeldon.utils.ValuesUtils;

/**
 * Declaration of error part of scenario.
 * 
 * @author szeldon
 * 
 */
public class ErrorPartDeclaration extends ScenarioPartDeclaration {

    private String description;

    /**
     * Creates "Error" part with description.
     * 
     * @param description
     */
    public ErrorPartDeclaration(String description) {
        this.description = ValuesUtils.checkNamedValueForNull("description", description);
    }

    @Override
    public ScenarioPartsTypeEnum getPartType() {
        return ScenarioPartsTypeEnum.ERROR_PART;
    }

    public String getDescription() {
        return description;
    }

    @Override
    public boolean isCondition() {
        return false;
    }

    @Override
    public String toString() {
        return "Error description=" + description + ";";
    }

}
